
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;

using Swaf;
using Swaf.Container;

namespace Swaf.DataAccess
{
	/// <summary>
	/// Any DAR decorator that wants to be a full stand-in must implement this interface.
	/// </summary>
	/// <remarks>
	/// The postFormat method of a DAR decorator is only called when the formatting
	/// is done through the get/put methods of the DAR itself.  If a manual execute
	/// to get an IDataResponse is done and then the format is done through that, then
	/// the postFormat method will not be called for the DAR.</remarks>
	public interface IDarDecorator : IDecorator
	{
		/// <summary>
		/// Called just before the main execute processing occurs and allows the
		/// info passed to the execute to be modified or inspected.  An exception
		/// thrown here will cancel the execution of the DAR.</summary>
		/// <param name="info"></param>
		void preExecute(ref INameAddressSupport info);
		/// <summary>
		/// Called immediately after the main execute processing of the DAR occurs
		/// and allows the info passed to be modified or inspected as well as the 
		/// IDataResponse to be modified or inspected.</summary>
		/// <param name="info"></param>
		/// <param name="resp"></param>
		void postExecute(ref INameAddressSupport info, ref IDataResponse resp);
		/// <summary>
		/// Called immediately after the results of the DAR execute are formatted
		/// and allows the results of formatting to be modified or inspected.</summary>
		/// <param name="formatedValue">The output provided by the formatter.</param>
		void postFormat(ref object formatedValue);
	}
}
